<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018\9\27 0027
 * Time: 10:33
 */

namespace app\behavior;


use think\Exception;

class AppException
{
    public function run( $e){
        if($e instanceof  Exception){
            if(request()->isAjax() ){
                //ViewBuilder::returnError([],$e->getMessage())->send();
                echo  $e->getMessage();
            }
            else{
                throw $e;
            }
        }
    }
}